package com.frameproject;



import android.os.Bundle;
import android.util.Log;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;


public class ActivityDemo2 extends AppCompatActivity {

    private  String TAG="Lifecycle";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        Log.i(TAG,"第二个界面 ---> onCreate ~~~~~~");
        findViewById(R.id.backBt).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ActivityDemo2.this.finish();
            }
        });
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.i(TAG,"第二个界面  ---> onStart ~~~~~~");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.i(TAG,"第二个界面  ---> onResume ~~~~~~");
    }


    @Override
    protected void onPause() {
        super.onPause();
        Log.i(TAG,"第二个界面  ---> onPause ~~~~~~");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.i(TAG,"第二个界面  ---> onStop ~~~~~~");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.i(TAG,"第二个界面  ---> onDestroy ~~~~~~");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.i(TAG,"第二个界面  ---> onRestart ~~~~~~");
    }
}


